home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / CPP / VCW411.ZIP / TRIANGLE.H < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-10  |  2.2 KB  |  100 lines

  1. #ifndef   __TRIANGLE_H
  2. #define   __TRIANGLE_H
  3.  
  4. // -[Keep_Heading]-
  5.  
  6.  
  7. // -[Copyright_Mesg]-
  8. // --------------------------------------------------------------- //
  9. // (c) Copyright 1993-1994. Step Ahead Software Pty Limited. All rights reserved.
  10. // Class Header Filename: TRIANGLE.h
  11. // Description: 
  12. // Implements triangle objects.
  13. // --------------------------------------------------------------- //
  14. #define    CC_GEN    1
  15. #include    "SHAPE.h"
  16.  
  17. #include  "genclsid.h"
  18.  
  19.  
  20. // -[Keep_h_Extras]-
  21.  
  22.  
  23. // -[Class_Dec]-
  24. class Triangle;
  25. typedef Triangle * PTriangle;
  26. typedef Triangle & RTriangle;
  27. typedef Triangle * & RPTriangle;
  28. typedef const Triangle * PCTriangle;
  29. typedef const Triangle & RCTriangle;
  30.  
  31.  class Triangle : public Shape
  32. {
  33. // -[Keep_Class_Extras]-
  34.  
  35.  
  36. // -[Member_Data_Decs]-
  37.   public:
  38.   protected:
  39.  
  40.     // Length of sides of triagles. (Assume equilateral triangle!)
  41.     int SideLength;
  42.   private:
  43.  
  44.  
  45. // -[Member_Function_Decs]-
  46.   public:
  47.  
  48.     Triangle(int InitX, int InitY, int InitSide);
  49.  
  50.     virtual hashValueType hashValue() const;
  51.  
  52.     virtual classType isA() const;
  53.  
  54.     virtual int isEqual(const Object& testObject) const;
  55.  
  56.     virtual char * nameOf() const;
  57.  
  58.     virtual void printOn(Rostream outputStream) const;
  59.  
  60.     virtual void Show(HDC hDC);
  61.   protected:
  62.   private:
  63.  
  64.  
  65. // -[Persistent_1]-
  66.   // OWL1.0 Streamability
  67.   public:
  68.     Triangle(StreamableInit); // Used to create a new object
  69.     static PTStreamable build();
  70.   protected:
  71.     virtual Pvoid read(Ripstream is);    virtual void write(Ropstream os);
  72.   private:
  73.     virtual const Pchar streamableName() const;
  74.  
  75. };
  76.  
  77. // -[Persistent_2]-
  78. // OWL1.0 Streamability
  79. inline Ripstream operator >> ( Ripstream is, RTriangle cl )
  80.   { return is >> (RTStreamable)cl; }
  81. inline Ripstream operator >> ( Ripstream is, RPTriangle cl )
  82.   { return is >> (RPvoid)cl; }
  83. inline Ropstream operator << ( Ropstream os, RCTriangle cl )
  84.   { return os << (RTStreamable)cl; }
  85. inline Ropstream operator << ( Ropstream os, PCTriangle cl )
  86.   { return os << (PTStreamable)cl; }
  87.  
  88.  
  89. // -[Keep]-
  90.  
  91.  
  92. // -[Global_Data_Decs]-
  93.  
  94.  
  95. // -[Global_Function_Decs]-
  96.  
  97. // -[Function_Defs]-
  98.  
  99. // -[End_Cond]-
  100. #endif    __TRIANGLE_H